﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EmoneyWeiXinEntity;
using EmoneyWeiXinDAL;
namespace EmoneyWeiXinBLL
{
    public class NewsModelManager
    {
        public static List<WeixinNewsModelEntity> getNewsModelList(int weixinid, int pindex, int psize, out int total)
        {
            return WeixinNewsModelDal.getNewsModelList(weixinid, pindex, psize, out total);
        }
        public static WeixinNewsModelEntity getNewsModelListByID(int id)
        {
            var obj= WeixinNewsModelDal.getNewsModelListByID(id);
            if (obj != null && obj.Count > 0)
                return obj[0];
            else
                return new WeixinNewsModelEntity();
        }

        public static int UpdateNewsModel(WeixinNewsModelEntity obj)
        {
            return WeixinNewsModelDal.UpdateNewsModel(obj);
        }
        public static int DeleteNewsModel(int id)
        {
            return WeixinNewsModelDal.DeleteNewsModel(id);
        }
        //

        public static List<WeixinNewsModelSettingEntity> getNewsModelFieldList(int mid,int pindex, int psize, out int total)
        {
            return WeixinNewsModelSettingFieldDal.getNewsModelFieldList(mid, pindex, psize, out total);
        }

        public static int UpdateNewsModelField(WeixinNewsModelSettingEntity obj)
        {
            return WeixinNewsModelSettingFieldDal.UpdateNewsModelField(obj);
        }

        public static int DeleteNewsFieldModel(int id,int status)
        {
            return WeixinNewsModelSettingFieldDal.DeleteNewsFieldModel(id,status);
        }
    }
}
